miax: add patch fixing compilation warning
authorChristian Marangi <[email protected]>
Mon, 10 Nov 2025 01:06:26 +0000 (02:06 +0100)
committerChristian Marangi <[email protected]>
Mon, 10 Nov 2025 01:06:26 +0000 (02:06 +0100)
Add 2 patch fixing compilation warning (now error) for implicit
declaration and incompatible pointer type.

Refresh all affected patch.

Signed-off-by: Christian Marangi <[email protected]>
net/miax/patches/001-cross.patch
net/miax/patches/010-usleep.patch
net/miax/patches/020-includes.patch
net/miax/patches/030-Fix-implicit-declaration-warning.patch [new file with mode: 0644]
net/miax/patches/031-Fix-incompatible-pointer-type-warning-in-oss-module.patch [new file with mode: 0644]

index f47c1101d9d5a6bd6629d3dd4b43cceb4d769e6a..da974eaf2c12c8ec580a923bee25ef4b20412309 100644 (file)
@@ -1,6 +1,5 @@
-diff -ruN miax-1.4-old/Makefile miax-1.4-new/Makefile
---- miax-1.4-old/Makefile      2005-04-27 18:56:13.000000000 +0200
-+++ miax-1.4-new/Makefile      2005-11-30 01:07:21.000000000 +0100
+--- a/Makefile
++++ b/Makefile
 @@ -1,4 +1,5 @@
 -CFLAGS= -Iiax/ -Igsm/inc -DIAXC_IAX2 -DLIBIAX -g -DPOSIXSLEEP -DLINUX -O2 
 +OFLAGS= -02 -g
@@ -8,7 +7,7 @@ diff -ruN miax-1.4-old/Makefile miax-1.4-new/Makefile
  SYSLIBS=-lpthread -lm -lbluetooth
  
  
-@@ -32,11 +33,10 @@
+@@ -32,11 +33,10 @@ OBJS=\
        miax.o
  
  all: $(OBJS)
index fe45b2b412b65dfc67c5409998dedad2f59c6d63..bcae8b7c37175c27ecbcd205a347c1e81a78593f 100644 (file)
@@ -1,6 +1,6 @@
 --- a/modem.c
 +++ b/modem.c
-@@ -76,10 +76,11 @@ int tty_modem(char* send, char *receive) {
+@@ -76,10 +76,11 @@ int tty_modem(char* send, char *receive)
        
        int l=0, in=0, out=0, timeout=10;
        char tmp[4096];
@@ -13,7 +13,7 @@
                        ioctl(fd_modem,TIOCMGET,&out);
                                if (out & TIOCM_CTS) {
                                l=write(fd_modem,send,strlen(send));
-@@ -97,7 +98,7 @@ int tty_modem(char* send, char *receive) {
+@@ -97,7 +98,7 @@ int tty_modem(char* send, char *receive)
                                strncat(receive,tmp,in); 
                                if (strchr(receive,'\r')) { break; }
                                }
index 4e667a26aecc3fc5189a6796973531ca22964396..ecba4250dd99b7e639b4adc3b9a0d82e28eac883 100644 (file)
@@ -10,7 +10,7 @@
  #define BLOCKLEN (RATE/100)
 --- a/iax/iax.c
 +++ b/iax/iax.c
-@@ -344,7 +344,7 @@ static int iax_sched_event(struct iax_event *event, struct iax_frame *frame, int
+@@ -343,7 +343,7 @@ static int iax_sched_event(struct iax_ev
  
        sched = (struct iax_sched*)malloc(sizeof(struct iax_sched));
        if (sched) {
@@ -19,7 +19,7 @@
                gettimeofday(&sched->when, NULL);
                sched->when.tv_sec += (ms / 1000);
                ms = ms % 1000;
-@@ -872,7 +872,7 @@ int iax_do_event(struct iax_session *session, struct iax_event *event)
+@@ -871,7 +871,7 @@ int iax_do_event(struct iax_session *ses
  
  #define MYSNPRINTF snprintf(requeststr + strlen(requeststr), sizeof(buf) - sizeof(struct ast_iax2_full_hdr) - strlen(requeststr), 
  
@@ -28,7 +28,7 @@
  
        /* Default some things in the frame */
  
-@@ -1523,7 +1523,7 @@ int iax_auth_reply(struct iax_session *session, char *password, char *challenge,
+@@ -1522,7 +1522,7 @@ int iax_auth_reply(struct iax_session *s
                MD5Update(&md5, (const unsigned char *) challenge, strlen(challenge));
                MD5Update(&md5, (const unsigned char *) password, strlen(password));
                MD5Final((unsigned char *) reply, &md5);
@@ -37,7 +37,7 @@
                convert_reply(realreply, (unsigned char *) reply);
                iax_ie_append_str(&ied, IAX_IE_MD5_RESULT, realreply);
        } else {
-@@ -1546,7 +1546,7 @@ static int iax_regauth_reply(struct iax_session *session, char *password, char *
+@@ -1545,7 +1545,7 @@ static int iax_regauth_reply(struct iax_
                MD5Update(&md5, (const unsigned char *) challenge, strlen(challenge));
                MD5Update(&md5, (const unsigned char *) password, strlen(password));
                MD5Final((unsigned char *) reply, &md5);
diff --git a/net/miax/patches/030-Fix-implicit-declaration-warning.patch b/net/miax/patches/030-Fix-implicit-declaration-warning.patch
new file mode 100644 (file)
index 0000000..0d59c3e
--- /dev/null
@@ -0,0 +1,142 @@
+From 4dec31e0f8fc5d838ac436dafce24630610d1a59 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <[email protected]>
+Date: Mon, 10 Nov 2025 01:56:00 +0100
+Subject: [PATCH 1/2] Fix implicit declaration warning
+
+Fix all implicit declaration warning in multiple source with a mix of
+extern usage and introducing proper header file for functions where
+possible.
+
+Signed-off-by: Christian Marangi <[email protected]>
+---
+ dtmf.c              |  1 +
+ dtmf.h              |  6 ++++++
+ iax/iax-client.h    |  1 +
+ iax/iaxclient_lib.h |  4 ++++
+ miax.c              |  1 +
+ miax.h              |  5 +++++
+ modem.c             |  1 +
+ modem.h             |  9 +++++++++
+ oss.c               |  2 ++
+ oss.h               | 10 ++++++++++
+ 10 files changed, 40 insertions(+)
+ create mode 100644 dtmf.h
+ create mode 100644 modem.h
+ create mode 100644 oss.h
+
+--- a/dtmf.c
++++ b/dtmf.c
+@@ -18,6 +18,7 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
++#include "dtmf.h"
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+--- /dev/null
++++ b/dtmf.h
+@@ -0,0 +1,6 @@
++#ifndef _dtmf_h
++#define _dtmf_h
++
++int dtmf(short *buf);
++
++#endif
+--- a/iax/iax-client.h
++++ b/iax/iax-client.h
+@@ -130,6 +130,7 @@ extern int iax_send_voice(struct iax_ses
+ extern int iax_send_image(struct iax_session *session, int format, char *data, int datalen);
+ extern int iax_send_url(struct iax_session *session, char *url, int link);
+ extern int iax_send_text(struct iax_session *session, char *text);
++extern int iax_send_ping(struct iax_session *session);
+ extern int iax_load_complete(struct iax_session *session);
+ extern int iax_reject(struct iax_session *session, char *reason);
+ extern int iax_busy(struct iax_session *session);
+--- a/iax/iaxclient_lib.h
++++ b/iax/iaxclient_lib.h
+@@ -255,5 +255,9 @@ extern double iaxc_silence_threshold;
+ extern iaxc_event_callback_t iaxc_event_callback;
+ extern MUTEX iaxc_lock;
++extern int audio_in(struct iaxc_call *call);
++extern int audio_out(struct iaxc_call *call, void *encoded);
++extern int miax_callback(struct iax_event *event, int callNo);
++
+ #endif
+--- a/miax.c
++++ b/miax.c
+@@ -18,6 +18,7 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
++#include <ctype.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+--- a/miax.h
++++ b/miax.h
+@@ -1,6 +1,9 @@
+ #ifndef _miax_h
+ #define _miax_h
++#include "modem.h"
++#include "oss.h"
++
+ /*
+ * Miax
+ *
+@@ -27,6 +30,8 @@ int  bt; //bluetooth
+ int   m=0; //modem
+ char  number[1024];
++int console_loop(int status, char *number);
++
+ int audio_init(char *dev, int compression) {
+       oss_audio_init(dev, compression);
+       }
+--- a/modem.c
++++ b/modem.c
+@@ -19,6 +19,7 @@
+ */
+                   
++#include "modem.h"
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+--- /dev/null
++++ b/modem.h
+@@ -0,0 +1,9 @@
++#ifndef _modem_h
++#define _modem_h
++
++int tty_modem_close();
++int tty_modem_init(char *dev);
++int tty_modem(char* send, char *receive);
++int tty_modem_loop(int status, char *number);
++
++#endif
+--- a/oss.c
++++ b/oss.c
+@@ -1,4 +1,6 @@
++#include "dtmf.h"
+ #include "iaxclient_lib.h"
++#include "oss.h"
+ #include <fcntl.h>
+ #include <string.h>
+ #include <unistd.h>
+--- /dev/null
++++ b/oss.h
+@@ -0,0 +1,10 @@
++#ifndef _oss_h
++#define _oss_h
++
++int oss_audio_in(struct iaxc_call *call);
++int oss_audio_out(struct iaxc_call *call, void *encoded);
++int oss_audio_close();
++int oss_audio_open();
++int oss_audio_init(char *dev, int enc);
++
++#endif
diff --git a/net/miax/patches/031-Fix-incompatible-pointer-type-warning-in-oss-module.patch b/net/miax/patches/031-Fix-incompatible-pointer-type-warning-in-oss-module.patch
new file mode 100644 (file)
index 0000000..0b0d07f
--- /dev/null
@@ -0,0 +1,33 @@
+From 691cf21ea7e77169a272e73735b207658741e2f1 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <[email protected]>
+Date: Mon, 10 Nov 2025 01:59:13 +0100
+Subject: [PATCH 2/2] Fix incompatible pointer type warning in oss module
+
+Fix incompatible pointer type warning in oss module for dtmf and
+gsm_decode functions.
+
+Signed-off-by: Christian Marangi <[email protected]>
+---
+ oss.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/oss.c
++++ b/oss.c
+@@ -38,7 +38,7 @@ int oss_audio_in(struct iaxc_call *call)
+                                       iax_send_voice(call->session, AST_FORMAT_SLINEAR, buf , RTP);
+                                       }
+               else {
+-                      if ((dtmf_c=dtmf(buf)) > 0) { 
++                      if ((dtmf_c=dtmf((short *)buf)) > 0) { 
+                               if (debug > 4) { fprintf(stderr, "Miax: dtmf %c\n", dtmf_c); }
+                               iax_send_dtmf(call->session,dtmf_c);
+                               }
+@@ -68,7 +68,7 @@ int oss_audio_out(struct iaxc_call *call
+                       }
+               else {  
+                       if (!call->gsmin) { call->gsmin = gsm_create(); }
+-                      gsm_decode(call->gsmin, encoded, data);
++                      gsm_decode(call->gsmin, encoded, (short *)data);
+                       }
+               for(i=ol;i<y;i++) {